package com.system.animal.service;

import com.system.animal.entity.Dog;
import com.system.animal.mapper.DogMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DogService {
    @Autowired
    private DogMapper dogMapper;
    public List<Dog> findAllDog() {
        System.out.println("Service层调用:: "+"查询所有狗狗");
        return dogMapper.selectDog();
    }
    public int addDog(Dog dog) {
        System.out.println("Service层调用:: "+"添加狗狗");
        return dogMapper.insertDog(dog);
    }
    public int delDog(int id){
        System.out.println("Service层调用:: "+"删除狗狗");
        return dogMapper.deleteDog(id);
    }
    public int updateDog(Dog dog){
        System.out.println("Service层调用:: "+"更新狗狗");
        return dogMapper.updateDog(dog);
    }
}
